package test2;

public class demo1 {

	public static void main(String[] args) {
		int[] nums = { 1, 2, 3, 4, 5, 6 };

		/*
		 * for (int array : nums) { System.out.println(array); }
		 */
		int[] name1=name1(nums);
		name(name1);
		
		int[][] array= {{1,2},{2,3},{3,4},{4,5}};
		for(int i=0;i<array.length;i++) {
			for(int j=0;j<array[i].length;j++) {
				System.out.print(array[i][j]);
			}
		}
	}
	
	//打印数组元素
	public static void name(int[] nums) {
		for (int i = 0; i < nums.length; i++) {
			System.out.println(nums[i]);
		}
	}
	
	//翻转数组
	
	public static int[] name1(int[] nums) {
		int[] result =new int[nums.length];
		
		for (int i=0,j=result.length-1; i < nums.length; i++,j--) {
			result[j]=nums[i];
		}
		return result;
	}
	
}
